class Properties // extends Object? wtf?
{
	var _props  : Dynamic; // A 'struct' with only Dynamic fields, yes, wasteful like hell... but hey it might work
	var _parent : Properties;
	
	public function new( ?json:Dynamic, ?parent:Properties=null ) {
	
		this._props = {};
		this._parent = parent;

		var arr_prop : Array<String> = Reflect.fields(json);
		for ( property in arr_prop ) // type(property) === String
		{
			Reflect.setField(_props,property,Reflect.field(json, property));
		}
	}
	
	public function get(name:String) : Dynamic {
		if ( Reflect.hasField(_props,name) )
			return Reflect.field(_props,name);
		if ( this._parent != null )
			return _parent.get( name );
		return Math.NaN;
	}
		
	// set does not recurse down, we don't want to set
	// our parents property
	public function set(name:String, value:Dynamic):Void {
		Reflect.setField(_props, name, value);
	}
	
	public function has(name:String):Bool {
		if (Reflect.hasField(_props, name)) return true;
		if ( _parent != null ) { return _parent.has(name); }
		return false;
	}
}
